﻿using Project;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public enum WeaponEnum
{
    None = 0,
    沙鹰手枪,
    散弹枪,
    冲锋枪,
    狙击枪,
    剑,
    长枪,
}
[Serializable]
public class WeaponInfo
{
    [Header("武器名字")] public WeaponEnum WeaponType;  //武器名字  
    [Framework.PnShowSprite]  public Sprite Icon;
    [Header("武器售价")] public int Coin;
    [Header("预制体")] public GameObject Prefab;
}
[CreateAssetMenu(fileName = "WeaponSO", menuName = "New WeaponSO")]
public class WeaponSO : ScriptableObject, IEnumerable<WeaponInfo>
{
    public List<WeaponInfo> weaponsList = new List<WeaponInfo>();

    public IEnumerator<WeaponInfo> GetEnumerator()
    {
        for (int i = 0; i < weaponsList.Count; i++)
        {
            yield return weaponsList[i];
        }
    }
    IEnumerator IEnumerable.GetEnumerator()
    {
        for (int i = 0; i < weaponsList.Count; i++)
        {
            yield return weaponsList[i];
        }
    }
   
}
